<div>

    <div class="ibox">
        <div class="ibox-title">
            <h5>
                <vc:i18n name="工单详情" namespace="ownerRepairDetail"></vc:i18n>
            </h5>
            <div class="ibox-tools" style="top:10px;">
                <button type="button" class="btn btn-primary btn-sm" v-on:click="_printRepairDetail()">
                    <vc:i18n name="打印" namespace="ownerRepairDetail"></vc:i18n>
                </button>
                <button type="button" class="btn btn-primary btn-sm" v-on:click="_goBack()">
                    <vc:i18n name="返回" namespace="ownerRepairDetail"></vc:i18n>
                </button>
            </div>
        </div>
        <div class="ibox-content">
            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="工单编码：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.repairId}}</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="报修类型：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.repairTypeName}}</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="报修人：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.repairName}}</label>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="联系方式：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.tel}}</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="位置：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.repairObjName}}</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="预约时间：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.appointmentTime}}</label>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="状态：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.stateName}}</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="报修内容：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.context}}</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-form-label"
                            v-if="ownerRepairDetailInfo.maintenanceType != null && ownerRepairDetailInfo.maintenanceType != ''">
                            <vc:i18n name="维修类型:" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="" v-if="ownerRepairDetailInfo.maintenanceType == '1001'">
                            <vc:i18n name="有偿服务" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="" v-if="ownerRepairDetailInfo.maintenanceType == '1002'">
                            <vc:i18n name="无偿服务" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="" v-if="ownerRepairDetailInfo.maintenanceType == '1003'">
                            <vc:i18n name="需要用料" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="" v-if="ownerRepairDetailInfo.maintenanceType == '1004'">
                            <vc:i18n name="无需用料" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-4"
                    v-if="ownerRepairDetailInfo.maintenanceType == '1001' || ownerRepairDetailInfo.maintenanceType == '1003'">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="用料：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.repairMaterials}}</label>
                    </div>
                </div>
                <div class="col-sm-4" v-if="ownerRepairDetailInfo.maintenanceType == '1001'">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="费用明细：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.repairFee}}
                            <span>
                                <vc:i18n name="元(单价*数量)" namespace="ownerRepairDetail"></vc:i18n>
                            </span>&nbsp;&nbsp;
                        </label>
                    </div>
                </div>
                <div class="col-sm-4" v-if="ownerRepairDetailInfo.appraiseScore != '0'">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="综合评价得分：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.appraiseScore}}
                            <span>
                                <vc:i18n name="分" namespace="ownerRepairDetail"></vc:i18n>
                            </span>
                        </label>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-4" v-if="ownerRepairDetailInfo.doorSpeedScore != '0'">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="上门速度评分：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.doorSpeedScore}}
                            <span>
                                <vc:i18n name="分" namespace="ownerRepairDetail"></vc:i18n>
                            </span>
                        </label>
                    </div>
                </div>
                <div class="col-sm-4" v-if="ownerRepairDetailInfo.repairmanServiceScore != '0'">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="维修员服务评分：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.repairmanServiceScore}}
                            <span>
                                <vc:i18n name="分" namespace="ownerRepairDetail"></vc:i18n>
                            </span>
                        </label>
                    </div>
                </div>
                <div class="col-sm-4" v-if="ownerRepairDetailInfo.average != '0.0'">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="平均分：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.average}}
                            <span>
                                <vc:i18n name="分" namespace="ownerRepairDetail"></vc:i18n>
                            </span>
                        </label>
                    </div>
                </div>
            </div>
            <div class="row" v-if="ownerRepairDetailInfo.visitType">
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="回访满意度：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.visitType=='1001'?'满意':'不满意'}}</label>
                    </div>
                </div>
                <div class="col-sm-8">
                    <div class="form-group">
                        <label class="col-form-label">
                            <vc:i18n name="回访内容：" namespace="ownerRepairDetail"></vc:i18n>
                        </label>
                        <label class="">{{ownerRepairDetailInfo.visitContext}}</label>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="ibox" v-if="ownerRepairDetailInfo.repairPhotos.length >0">
        <div class="ibox-title">
            <h5>
                <span>
                    <vc:i18n name="工单图片" namespace="ownerRepairDetail"></vc:i18n>
                </span>
            </h5>
            <div class="ibox-tools" style="top:10px;"></div>
        </div>
        <div class="ibox-content">
            <div class="row">
                <div class="form-group margin-left" v-for="(item,index) in ownerRepairDetailInfo.repairPhotos">
                    <img style="width: 120px; height: 120px;" v-bind:src="item.url" v-on:click="openFile(item)" />
                </div>
            </div>
        </div>
    </div>


    <div class="ibox" v-if="ownerRepairDetailInfo.beforePhotos.length >0">
        <div class="ibox-title">
            <h5>
                <vc:i18n name="维修前图片" namespace="ownerRepairDetail"></vc:i18n>
            </h5>
            <div class="ibox-tools" style="top:10px;"></div>
        </div>
        <div class="ibox-content">
            <div class="row">
                <div class="form-group margin-left" v-for="(item,index) in ownerRepairDetailInfo.beforePhotos">
                    <img style="width: 120px; height: 120px;" v-bind:src="item.url" v-on:click="openFile(item)" />
                </div>
            </div>
        </div>
    </div>

    <div class="ibox" v-if="ownerRepairDetailInfo.afterPhotos.length >0">
        <div class="ibox-title">
            <h5>
                <vc:i18n name="维修后图片" namespace="ownerRepairDetail"></vc:i18n>
            </h5>
            <div class="ibox-tools" style="top:10px;"></div>
        </div>
        <div class="ibox-content">
            <div>
                <div class="row">
                    <div class="form-group margin-left" v-for="(item,index) in ownerRepairDetailInfo.afterPhotos">
                        <img style="width: 120px; height: 120px;" v-bind:src="item.url" v-on:click="openFile(item)" />
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="ibox"
        v-if="ownerRepairDetailInfo.maintenanceType == '1001' || ownerRepairDetailInfo.maintenanceType == '1003'">
        <div class="ibox-title">
            <h5>
                <vc:i18n name="相关物品" namespace="ownerRepairDetail"></vc:i18n>
            </h5>
            <div class="ibox-tools" style="top:10px;"></div>
        </div>
        <div class="ibox-content">
            <table class="table table-stripped">
                <thead>
                    <tr>
                        <th scope="col" class="text-center">
                            <vc:i18n name="物品资源编号" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="物品资源类型" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="物品资源名称" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="物品资源规格" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="物品使用数量" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="物品价格" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="使用人" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="时间" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="(item,index) in ownerRepairDetailInfo.resourceStoreInfo">
                        <td scope="row" class="text-center">{{item.resId}}</td>
                        <td class="text-center">{{item.parentRstName}} > {{item.rstName}}</td>
                        <td class="text-center">{{item.resourceStoreName}}</td>
                        <td class="text-center">{{item.specName? item.specName : '-'}}</td>
                        <td class="text-center">{{item.quantity}}{{item.miniUnitCodeName}}</td>
                        <td class="text-center">{{item.unitPrice? item.unitPrice : '-'}}</td>
                        <td class="text-center">{{item.createUserName}}</td>
                        <td class="text-center">{{item.createTime}}</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="ibox">
        <div class="ibox-title">
            <h5>
                <vc:i18n name="工单流转" namespace="ownerRepairDetail"></vc:i18n>
            </h5>
            <div class="ibox-tools" style="top:10px;"></div>
        </div>
        <div class="ibox-content">
            <table class="table table-stripped">
                <thead>
                    <tr>
                        <th scope="col" class="text-center">
                            <vc:i18n name="序号" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="处理人" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="状态" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="处理开始时间" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="处理结束时间" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="耗时" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                        <th scope="col" class="text-center">
                            <vc:i18n name="意见" namespace="ownerRepairDetail"></vc:i18n>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="(item,index) in ownerRepairDetailInfo.repairUsers">
                        <td scope="row" class="text-center">{{index+1}}</td>
                        <td class="text-center">{{item.staffName}}</td>
                        <td class="text-center" v-if="(item.state == '10009' || item.state == '12000') && item.payTypeName != null && item.payTypeName != undefined
                                && item.payTypeName != ''">
                            {{item.stateName}}({{item.payTypeName}})
                        </td>
                        <td class="text-center" v-else>
                            {{item.stateName}}
                            <span v-if="item.state == '10007'">
                                (<a href="javascript:void(0)" @click="_openRepairAppraise(item)">回复</a>)
                            </span>
                        </td>
                        <td class="text-center">{{item.startTime}}</td>
                        <td class="text-center">{{item.endTime}}</td>
                        <td class="text-center">{{item.duration}}</td>
                        <td class="text-center">{{item.context}}</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <vc:create path="common/viewImage"></vc:create>
    <vc:create path="property/replyRepairAppraise"></vc:create>
</div>